import java.awt.BorderLayout;

import javax.swing.JFrame;

import de.fhwgt.dionarap.controller.DionaRapController;
import de.fhwgt.dionarap.model.data.DionaRapModel;
import de.fhwgt.dionarap.model.events.DionaRapChangedEvent;
import de.fhwgt.dionarap.model.objects.AbstractPawn;


public class Hauptfenster extends JFrame
{
	private Spielflaeche spielFlaeche;
	private Navi navi;
	private DionaRapModel model;
	private DionaRapController controller;
	public Hauptfenster()
	{
		System.out.println("Hauptfenster");
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("DionaRap");
		this.setLayout(new BorderLayout());
		this.setLocationRelativeTo(null);
		
		this.model = new DionaRapModel();
		this.controller = new DionaRapController(this.model);
		
		this.getAllPlayElements();
		
		this.spielFlaeche = new Spielflaeche();
		this.add(spielFlaeche, BorderLayout.CENTER);
		
		this.setResizable(false);
		this.setVisible(true);
		this.pack();
		this.navi = new Navi(this);
	}
	
	public static void main(String[] args)
	{
		new Hauptfenster();
	}
	
	public DionaRapModel getModel()
	{
		return this.model;
	}

	public DionaRapController getController() 
	{
		return this.controller;
	}
	
	public void getAllPlayElements()
	{
		AbstractPawn pawns[] = this.model.getAllPawns();
		for(int i = 0; i <= pawns.length; i++)
		{
			//this.spielFlaeche.setGameElement(pawns[i]);
			System.out.println(""+i);
		}
	}
	
}
